<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ page session="false"%>
<html>
<head>
	<title>ModernWebshop Client</title>
	<style type="text/css">
		<%@ include file="/resources/css/styles.css"%>
	</style>
</head>
<body>

	<div class="wrapper">
		<div class="left">

			<div class="teaser">
				<h1>ModernWebstore</h1>
				<h3>Fill the form and submit</h3>
			</div>

			<div class="teaser">
				<h2>Navigation</h2>
				<a href="home" class="more">Go to store</a> <a href="basket"
					class="more">Go to basket</a>
			</div>

			<c:forEach var="item" items="${items}" varStatus="loop">
				<div class="item-${loop.count} teaser">
					<img class="icon" src="${item.imageUrl}" />
					<h2>${amount.get(item.id)}  ${item.name}(s) to pay $${item.price}</h2>
					<p>${item.description}</p>
					<br />
				</div>
			</c:forEach>

			<c:if test="${not empty total}">
				<div class="teaser">
					<h2>Brings you to a total of $${total}</h2>
				</div>
			</c:if>
			
			<div class="teaser">
				<c:if test="${not empty message}">
					<h2>${message}</h2>
				</c:if>
				<c:if test="${empty message}">
					<h2>Fill in payment form</h2>

					<form:form method="post" commandName="payment">
						<form:label path="name">Name:</form:label>
						<form:input type="text" path="name" />
						<br />
						<form:label path="address">Address:</form:label>
						<form:input type="text" path="address" />
						<br />
						<form:label path="bankInfo">Bank info:</form:label>
						<form:input type="text" path="bankInfo" />
						<br />
						<input type="submit" name="payment" value="Submit payment" />
						<br />
					</form:form>
				</c:if>
			</div>

		</div>
	</div>

</body>
</html>
